// ###第一层中间件###
// koa_response_duration.js 是计算服务器处理时长的中间件
module.exports = async (ctx, next) => {
  const start = Date.now();
  await next();
  const end = Date.now();
  const duration = end - start;
  ctx.set('X-Response-Time',duration+'ms')
}